<template>
  <div>
    <ul class="list-group list-group-striped">
      <li class="list-group-item">
        {{ t('cms.license.appid') }}
        <div class="pull-right">{{ lincenseInfo?.appid }}</div>
      </li>
      <li class="list-group-item">
        {{ t('cms.license.productName') }}
        <div class="pull-right">{{ lincenseInfo?.productName }}</div>
      </li>
      <li class="list-group-item">
        {{ t('cms.license.version') }}
        <div class="pull-right">{{ lincenseInfo?.version }}</div>
      </li>
      <li class="list-group-item">
        {{ t('cms.license.productGrade') }}
        <div class="pull-right">{{ lincenseInfo?.productGrade }}</div>
      </li>
      <li class="list-group-item">
        {{ t('cms.license.project') }}
        <div class="pull-right">{{ lincenseInfo?.project }}</div>
      </li>
      <li class="list-group-item">
        {{ t('cms.license.expiration') }}
        <div class="pull-right">{{ formatDate(lincenseInfo?.expiration) }}</div>
      </li>
      <li class="list-group-item">
        {{ t('cms.license.macAddress') }}
        <div class="pull-right">{{ lincenseInfo?.macAddress }}</div>
      </li>
    </ul>
  </div>
</template>
<script lang="ts" setup>
import { formatDate } from '@/utils/formatTime'
import { getLicense } from '@/api/cms/system/index'
import { LicenseVo } from '@/api/cms/system/types'

defineOptions({ name: 'License' })

const { t } = useI18n()
const lincenseInfo = ref<LicenseVo>()
const getLicenseInfo = async () => {
  const lincese = await getLicense()
  lincenseInfo.value = lincese
}
onMounted(async () => {
  await getLicenseInfo()
})
</script>

<style scoped>
.text-center {
  position: relative;
  height: 120px;
  text-align: center;
}

.list-group-striped > .list-group-item {
  padding-right: 0;
  padding-left: 0;
  border-right: 0;
  border-left: 0;
  border-radius: 0;
}

.list-group {
  padding-left: 0;
  list-style: none;
}

.list-group-item {
  padding: 11px 0;
  margin-bottom: -1px;
  font-size: 13px;
  border-top: 1px solid #e7eaec;
  border-bottom: 1px solid #e7eaec;
}

.pull-right {
  float: right !important;
}
</style>
